home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / dos_.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.9 KB  |  83 lines

  1. /* Copyright (C) 1991, 1992, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: dos_.h,v 1.2 2000/09/19 19:00:09 lpd Exp $ */
  20. /* Generic MS-DOS interface */
  21.  
  22. #ifndef dos__INCLUDED
  23. #  define dos__INCLUDED
  24.  
  25. /* This file is needed because the various DOS compilers */
  26. /* provide slightly different procedures for interfacing to DOS and */
  27. /* the I/O hardware, and because the Watcom compiler is 32-bit. */
  28. #include <dos.h>
  29. #if defined(__WATCOMC__) || defined(_MSC_VER)
  30.  
  31. /* ---------------- Microsoft C/C++, all models; */
  32. /* ---------------- Watcom compiler, 32-bit flat model. */
  33. /* ---------------- inp/outp prototypes are in conio.h, not dos.h. */
  34.  
  35. #  include <conio.h>
  36. #  define inport(px) inpw(px)
  37. #  define inportb(px) inp(px)
  38. #  define outport(px,w) outpw(px,w)
  39. #  define outportb(px,b) outp(px,b)
  40. #  define enable() _enable()
  41. #  define disable() _disable()
  42. #  define PTR_OFF(ptr) ((ushort)(uint)(ptr))
  43. /* Define the structure and procedures for file enumeration. */
  44. #define ff_name name
  45. #define dos_findfirst(n,b) _dos_findfirst(n, _A_NORMAL | _A_RDONLY, b)
  46. #define dos_findnext(b) _dos_findnext(b)
  47.  
  48. /* Define things that differ between Watcom and Microsoft. */
  49. #  ifdef __WATCOMC__
  50. #    define MK_PTR(seg,off) (((seg) << 4) + (off))
  51. #    define int86 int386
  52. #    define int86x int386x
  53. #    define rshort w
  54. #    define ff_struct_t struct find_t
  55. #  else
  56. #    define MK_PTR(seg,off) (((ulong)(seg) << 16) + (off))
  57. #    define cputs _cputs
  58. #    define fdopen _fdopen
  59. #    define O_BINARY _O_BINARY
  60. #    define REGS _REGS
  61. #    define rshort x
  62. #    define ff_struct_t struct _find_t
  63. #    define stdprn _stdprn
  64. #  endif
  65.  
  66. #else /* not Watcom or Microsoft */
  67.  
  68. /* ---------------- Borland compiler, 16:16 pseudo-segmented model. */
  69. /* ---------------- ffblk is in dir.h, not dos.h. */
  70. #include <dir.h>
  71. #  define MK_PTR(seg,off) MK_FP(seg,off)
  72. #  define PTR_OFF(ptr) FP_OFF(ptr)
  73. /* Define the regs union tag for short registers. */
  74. #  define rshort x
  75. /* Define the structure and procedures for file enumeration. */
  76. #define ff_struct_t struct ffblk
  77. #define dos_findfirst(n,b) findfirst(n, b, 0)
  78. #define dos_findnext(b) findnext(b)
  79.  
  80. #endif
  81.  
  82. #endif /* dos__INCLUDED */
  83.